package com.steven.realServer.utils;

import com.steven.realServer.pojo.UserAllDetail;

public class NameUtils {
    public static String getUserName(UserAllDetail userAllDetail) {
        if (userAllDetail == null)
            return null;
        if (userAllDetail.getUserInfo() != null) {
            if (userAllDetail.getUserDetail() != null) {
                //已提交认证资料
                if (userAllDetail.getUserDetail().getStatus() == 2) {
                    return userAllDetail.getUserDetail().getUname();
                } else if (userAllDetail.getUserDetail().getStatus() == 0) {
                    if (userAllDetail.getUserDetail().getUname() == null) {
                        return userAllDetail.getUserInfo().getEmail() + "(未认证)";
                    } else {
                        return userAllDetail.getUserDetail().getUname() + "(待认证)";
                    }
                } else {
                    return userAllDetail.getUserInfo().getEmail() + "(未认证)";
                }
            } else {
                return userAllDetail.getUserInfo().getEmail() + "(未认证)";
            }
        } else {
            return null;
        }
    }
}
